package com.module.ble.db

import com.common.app.helper.UserHelper
import com.module.ble.repo.HealthIntegratedDataRepo

/**
 * 作者：sosou
 * <p>
 * 版本：1.0
 * <p>
 * 创建日期：2024/10/18
 * <p>
 * 描述：
 * <p>
 * 修订历史：
 */
object HealthExaManager {

    private var TAG = HealthExaManager::class.java.simpleName

    val mHeartRateDao: HeartRateDao? by lazy {
        HealthExaAppDataBase.getDb(UserHelper.getUserDbName())?.getHeartRateDaoDao()
    }
    val mHeartRateVariabilityDao: HeartRateVariabilityDao? by lazy {
        HealthExaAppDataBase.getDb(UserHelper.getUserDbName())?.getHeartRateVariabilityDao()
    }
    val mBloodOxygenDao: BloodOxygenDao? by lazy {
        HealthExaAppDataBase.getDb(UserHelper.getUserDbName())?.getBloodOxygenDao()
    }
    val mBodyTemperatureDao: BodyTemperatureDao? by lazy {
        HealthExaAppDataBase.getDb(UserHelper.getUserDbName())?.getBodyTemperatureDao()
    }
    val mEnvTemperatureDao: EnvTemperatureDao? by lazy {
        HealthExaAppDataBase.getDb(UserHelper.getUserDbName())?.getEnvTemperatureDao()
    }

    val mStepNumberDao: StepNumberDao? by lazy {
        HealthExaAppDataBase.getDb(UserHelper.getUserDbName())?.getStepNumberDao()
    }

    val mSleepInfoDao: SleepInfoDao? by lazy {
        HealthExaAppDataBase.getDb(UserHelper.getUserDbName())?.getSleepInfoDao()
    }

    val mHeartEntryTimeDao: HeartEntryTimeDao? by lazy {
        HealthExaAppDataBase.getDb(UserHelper.getUserDbName())?.getHeartTimeEntryDao()
    }

    val mSportRecordDao: SportRecordDao? by lazy {
        HealthExaAppDataBase.getDb(UserHelper.getUserDbName())?.getSportRecordDao()
    }

    val mHealthIntegratedDataDao: HealthIntegratedDataDao? by lazy {
        HealthExaAppDataBase.getDb(UserHelper.getUserDbName())?.getHealthIntegratedDataDao()
    }

    val mStepsRelatedRecordDao: UserStepsRelatedRecordDao? by lazy {
        HealthExaAppDataBase.getDb(UserHelper.getUserDbName())?.getStepsRelatedRecordDao()
    }

    val mRespiratoryRateDao: RespiratoryRateDao? by lazy {
        HealthExaAppDataBase.getDb(UserHelper.getUserDbName())?.getRespiratoryRateDao()
    }

    val mUserStressDao: UserStressDao? by lazy {
        HealthExaAppDataBase.getDb(UserHelper.getUserDbName())?.getUserStressDao()
    }

    val mUserStandDao: UserStandDao? by lazy {
        HealthExaAppDataBase.getDb(UserHelper.getUserDbName())?.getUserStandDao()
    }

    val mUserCalorieDao: UserCalorieDao? by lazy {
        HealthExaAppDataBase.getDb(UserHelper.getUserDbName())?.getUserCalorieDao()
    }

    val mUserAcLevelDao: UserAcLevelDao? by lazy {
        HealthExaAppDataBase.getDb(UserHelper.getUserDbName())?.getUserAcLevelDao()
    }

    fun closeDatabase() {
        HealthExaAppDataBase.mChatDataBase?.close()
    }
}